import request from '@/router/axios';

// 产品组装列表
export const getList = (current, size, params) => {
  return request({
    url: '/api/mes-product/product/component/list',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

// 查询已完成的组装信息
export const queryPageBoundProductComponentInfo = (current, size, params) => {
  return request({
    url: '/api/mes-product/product/component/query-page-bound-product-component-info',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};
// 根据组装条码查询组装基本信息
export const getProductComponentInfo = (sequenceNumber) => {
  return request({
    url: `/api/mes-product/product/assemble/detail/list-by-sn?sequenceNumber=${sequenceNumber}`,
    method: 'get',
    data: {

    }
  });
};

export const getProductByWorkOrderNo = (workOrderNo) => {
  return request({
    url: `api/mes-product/work-order/detail-simply?workOrderNo=${workOrderNo}`,
    method: 'get',
    params: {}
  });
};

export const getProductListByWorkOrderNo = (current, size, params) => {
  return request({
    url: '/api/mes-product/product/assemble/detail/list-by-work-order-no',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

// 组装解绑
export const componentUnbound = (data) => {
  return request({
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    url: `/api/mes-product/product/assemble/detail/unbound`,
    method: 'post',
    data: data
  });
};
